//
//  DiaryEditReasonCollectionViewCell.swift
//  MoodDiary
//
//  Created by MoodDiary on 2020/12/8.
//

import UIKit

class DiaryEditReasonCollectionViewCell: UICollectionViewCell {

    var isSelectCell: Bool? {
        didSet {
            if isSelectCell == true {
                createShadow(hasShadow: false)
            } else {
                createShadow()
            }
        }
    }
    
    @IBOutlet weak var imgV: UIImageView!
    @IBOutlet weak var bgView: UIView!
    @IBOutlet weak var label: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        
        createShadow()
    }
    
    func createShadow(hasShadow: Bool = true) {
        bgView.layer.cornerRadius = 12.0
        
        guard hasShadow == true else {
            bgView.layer.borderWidth = 1.0
            bgView.layer.borderColor = UIColor.hexColor(hex: "#F8AE00").cgColor
            return
        }
        bgView.layer.borderWidth = 0
        bgView.layer.borderColor = UIColor.clear.cgColor
    }
}
